<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <!-- <meta charset="gb2312"> -->
    
    <meta name="author" content="">

    <meta name="Keywords" content="">
    <meta name="description" content="">
    
    <!-- 启用360浏览器的极速模式(webkit)-->
        <meta name="renderer" content="webkit">          
        <!-- 避免IE使用兼容模式 -->
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
    
    <!-- mobile -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no" />
    
    <link rel="shortcut icon" href="favicon.ico" type="images/x-icon" />
    <link rel="bookmark" href="favicon.ico" />
    
    <title>金塔珠宝</title>
    <!--[if lt IE 9 ]>
            <script src="js/hack/html5shiv.js"></script>
        <![endif]-->
<!--        <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>-->
        
        <!-- <script src="http://192.168.1.106:8008/con/assets/js/f5.js"></script> -->
        

    <link rel="stylesheet" href="../Public/css/base.css">
    <link rel="stylesheet" href="../Public/css/common.css">
    <link rel="stylesheet" href="../Public/css/page.css">
    <link rel="stylesheet" href="../Public/css/font.css">
        <link rel="stylesheet" href="../Public/css/responsive.css">
        
        
  </head>
  <body>
        <!-- nav [[ -->
<include file="Common:header"/>
    <!-- nav ]] -->

    <!-- header [[ -->
<!--         <header class="header">
    <div class="title">
        <div class="bg">
            <span class="icon"></span>
            <span class="txt">账号注册</span>
        </div>
    </div>
</header> -->
    <!-- header ]] -->
        
        <!-- content [[ -->
        <div class="mod_form">
            <form action="">
                <dl class="form_wrap">
               
                    <dd>
                        <input class="pwd" id="password" type="password" name="password" value="" placeholder="输入原密码">
                        <span class="hint">提示内容</span>
                    </dd>
                     <dd>
                        <input class="pwd" id="newpassword" type="password" name="newpassword" value="" placeholder="新密码至少六位">
                        <span class="hint">提示内容</span>
                    </dd>
                     <dd>
                        <input class="pwd" id="renewpassword" type="password" name="renewpassword" value="" placeholder="确认新密码">
                        <span class="hint">提示内容</span>
                    </dd>
                    <dd class=""><input class="mod_btn btn" id="submit" type="submit" value="确定"></dd>
          
                    
                </dl>
            </form>
        </div>
        <!-- content ]] -->
        
        <!-- footer [[ -->
        <include file="Common:footer"/>

<script type="text/javascript" src="../Public/layer/layer.js"></script>
  <script>
 $(function(){
$('#submit').click(function(){
 var oldpassword=$("#password").val();
    var newpassword=$("#newpassword").val();
    var renewpassword=$("#renewpassword").val();
    if(oldpassword==""){
        layer.msg("请输入原密码",{time:1000});
        return false;
    }else if(newpassword==""){
        layer.msg("请输入新密码",{time:1000});
        return false;
    }else if(renewpassword==""){
        layer.msg("请确认新密码",{time:1000});
        return false;
    }else if (renewpassword!=newpassword){
        layer.msg("两次输入密码不同",{time:1000});
        return false;
    }else if (oldpassword==newpassword){
        layer.msg("新旧密码相同",{time:1000});
        return false;
    }else{
        $.ajax({
            url:'index.php?m=home&c=User&a=modifyPassword',
            data:{
               'newpassword':newpassword,
                 'oldpassword':oldpassword
            },
            type:'post',
            success:function(data){
                    if(data==0){
                  layer.msg("修改失败",{time:1000});
                        return false;
                  }else if (data==1) {
                      layer.msg("原密码错误",{time:1000});
                        return false;
                  }else if(data==2){
                    layer.msg("修改成功",{time:1000},function(){
                         location.href="{:U('User/my')}";


                    });
                        
                    }
            }

        });
    }
                  return false;
})






 })



  </script>      

  </body>
</html>